<?php
namespace app\api\controller\v1;

use app\lib\exception\CategoryException;
use app\api\model\Category as CategoryModal;

class Category{
    public function getAllCategories(){
        $catetories = CategoryModal::with(['img'])
                    ->select();
        if(empty($catetories)){
            throw new CategoryException();
        };
        return $catetories;
    }
    
}

?>